fix: Correct dpad axis mapping and add support for start/select/home buttons (iOS)#65
Conversation
… for start/select/home buttons
luanpotter
left a comment
There was a problem hiding this comment.
LGTM, I think genering the timestamp is totally fine if one is not provided by the platform.
|
Hi, It seems to me that this fix introduced some incorrect behaviour that was working correctly before. I recently updated the Another missing feature I noticed is that the 'home' button on the Xbox controller isn't getting mapped with the latest version, while it did get mapped with the older version of the code (the 'options' and 'menu' buttons do work). Also, the d-pad is now mapped as an analog button, whereas previously it was non-analog, which seems to be a better fit. Are there controllers on which the signal is actually analog? Also, the older version is working fine for me for the dead, getting -1, 0, 1 values across both axes. I'm not sure what the required change would be for these issues, but from the older version working properly I guess it should be doable, and it should be fixed in order not to lose previously existing functionality. By the way, can I ask what was the fundamental problem with the previous code logic that warranted the substantial reworking? @wantroba could you please look into these issues? |
I rewrote GamepadsIosPlugin.swift following Apple's documentation https://developer.apple.com/documentation/gamecontroller and also keeping the plugin consistent and working.
With this I fixed the dpad axis mapping issue that appeared in #64. In addition, now the buttons buttonMenu, buttonOptions and buttonHome are also mapped when available.
Note: The only thing I couldn't keep was the timestamp that used to come from the event, now the time is generated by the plugin. If there is a need and a way to retrieve this value please let me know or correct my code for it.